<template>
    <div>
        <detail title="查看项目" :data="data" @close="close"></detail>
+
    </div>
</template>
<script setup lang="ts">
import { ref,h,onMounted, onActivated} from 'vue'
import detail, { type DetailType } from '@/components/myList/detail.vue';

import uploadImg from '@/components/uploadImg.vue'

import { useRouter } from "vue-router"
import { useTabStore } from '@/stores/tab'
import type { Project } from '@/types/Project'


import {useProjectStore} from '@/stores/project'
const projectStore = useProjectStore()
const tabStore = useTabStore()
const router = useRouter()
const formState = ref<Project>({})
const formRef = ref()
const lookVisible = ref(false)
const lookData = ref<{lng:number,lat:number, title:string}>()
const data = ref<DetailType[]>([])

const close = () => {
    router.back()
    tabStore.removeTab(router.currentRoute.value.fullPath)
}


onMounted(() => {
    formState.value = projectStore.updateProject

    data.value = [
        {name: '名称', val: formState.value.name},
        {name: '建立时间', val: formState.value.createTime},     
        {name: '所在区域', val: formState.value.provinceName! + formState.value.cityName + formState.value.areaName },
        {name: '项目介绍', val: formState.value.remark, isTr: true},
        {name: '图片上传', val: h(uploadImg, {list: formState.value.imgList, onlyLook: true}), isTr: true, height:120},

    ]
})
</script>
<style scoped>

</style>